package cl.pds.pruebacliente;

import java.io.IOException;
import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParserException;

import cl.pds.pruebacliente.Constantes;

import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

public class Pestana0 extends ListActivity {
	

	private TextView txtResultadoServicio;
	ArrayList<Paciente> pacientes;
	private String URL ="";
	private String NAMESPACE = "http://";
	
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        pacientes = new ArrayList<Paciente>();
        txtResultadoServicio = (TextView) findViewById(R.id.TxtResultadoServicio);
    }
    
    
    
    @Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		pacientes = new ArrayList<Paciente>();
		setListAdapter(new PacientesAdapter(Pestana0.this, 0, pacientes));
	}



	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		// TODO Auto-generated method stub
    	Intent intent = new Intent(Pestana0.this, UpdatePacienteActivity.class);
    	intent.putExtra("paciente", pacientes.get(position));
    	startActivity(intent);
	}

	/**
     * @param v
     */
   
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    


}
